//调用父类的构造函数
#include <iostream>
#include <string>
using namespace std;

class Fish
{
protected:
    bool FreshWater;
public:
    Fish(bool IsFreshWater)
    {
        FreshWater = IsFreshWater;
    }

    void Swim(void)
    {
        if(FreshWater)
        {
            cout << "It likes living in lakes" << endl;
        }
        else cout << "It likes living in sea" << endl;
    }

};

class Carp:public Fish
{
public:
    Carp(bool flag):Fish(true){}
};

class Tuna:public Fish
{
public:
    Tuna(bool flag):Fish(false){}
};

int main()
{
    Carp mycarp(true);
    Tuna mytuna(false);
    mycarp.Swim();
    mytuna.Swim();
    return 0;
}
